{% extends "base.html" %}
{% block content %}

            <div id="top-stories">
                <h2>Documents by category: {{ category }}</h2>
                {% for document in documents %}
                {% if document.imagelink %}<div class="article-image"><img class="small-image" src="{{ document.imagelink }}" /></div>{% endif %}


                <h3 class="article-title"><a href="{{ document.location  }}">{{ document.title }} (.pdf)</a></h3>
                <div class="article-date">{{ document.date|date:"D, F d Y" }} - by {{ document.postedby }}</div>
                <div class="article-category">{% for category in document.categories %}
                {{ category }}{% if not forloop.last %}, {% endif %}
                {% endfor %}</div>
                <!--{% if article.imagelink %}
                <img src="{{ article.imagelink }}">
                {% endif %}-->
                <p class="article-content">{{ document.summary }} <a href="{{ document.location }}">View Document (.pdf)</a></p>
                {% endfor %}
                <div id="pagination">
                    {% if prevpage %}
                        <span id="prev"><a href="/documentcategory?category={{category}}&page={{ prevpage }}">< Prev Page</a></span>
                    {% endif %}
                    {% if nextpage %}
                        <span id="next"><a href="/documentcategory?category={{category}}&page={{ nextpage }}"> Next Page ></a></span>
                    {% endif %}
                </div>
            </div>
{% endblock %}